﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class admin_mana : System.Web.UI.Page
{
    DB DBAdmin = new DB();
    protected void Page_Load(object sender, EventArgs e)
    {
        string strConfig = "select * from voteConfig where configId=1";
        SqlDataReader sdrConfig = DBAdmin.getSdr(strConfig);
        if (sdrConfig.Read())
        {
            if (sdrConfig.GetInt32(1) > 0)
            {
                int timeLength = sdrConfig.GetInt32(2);
                if (timeLength == 0)
                {
                    Label1.Text = "投票限制ip，一个ip只能投一次票";
                }
                else
                {
                    Label1.Text = "投票限制ip，两次投票时间间隔不低于" + timeLength.ToString() + "小时";
                }
            }
            else
            {
                Label1.Text = "投票不限制ip";
            }
        }
        sdrConfig.Close();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("../vote.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("../showResult.aspx");
    }
}
